<template>
  <div class="nav_bar">
    <div class="nav_bar_content">
      <div class="logo" @click="backHome">
        <img src="" alt="">
      </div>
      <div class="right">
        <div class="login" v-if="!isLogin" @click="login">管理员登录</div>
        <div class="logout" v-else>注销</div>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "NavBar",
    data() {
      return {
        isLogin: false
      }
    },
    methods: {
      backHome() {
        this.$router.push({path: '/home'})
      },
      login() {
        this.$router.push({path: '/login'})
      }
    }
  }
</script>

<style scoped>
  .nav_bar {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 9999;
    width: 100%;
    height: 64px;
    background-color: #002766;
  }

  .nav_bar_content {
    width: 1100px;
    height: 64px;
    margin: 0 auto;
  }

  .logo {
    float: left;
    width: 150px;
    height: 40px;
    margin-top: 12px;
    background-color: #fff;
  }

  .right {
    float: right;
    margin-right: 50px;
    line-height: 64px;
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
  }
</style>
